# Description:
#   This package contains projection methods for vectors.

package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

# Libraries
# ========================================================================

cc_library(
    name = "projection_base",
    srcs = ["projection_base.cc"],
    hdrs = ["projection_base.h"],
    tags = ["local"],
    deps = [
        "//scann/data_format:datapoint",
        "//scann/data_format:dataset",
        "//scann/oss_wrappers:scann_aligned_malloc",
        "//scann/oss_wrappers:scann_down_cast",
        "//scann/oss_wrappers:tf_dependency",
        "//scann/utils:types",
        "//scann/utils:util_functions",
        "@com_google_absl//absl/base",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
    ],
)

cc_library(
    name = "chunking_projection",
    srcs = ["chunking_projection.cc"],
    hdrs = ["chunking_projection.h"],
    tags = ["local"],
    deps = [
        ":identity_projection",
        ":projection_base",
        "//scann/data_format:datapoint",
        "//scann/oss_wrappers:scann_status",
        "//scann/proto:projection_cc_proto",
        "//scann/utils:common",
        "//scann/utils:datapoint_utils",
        "//scann/utils:types",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "identity_projection",
    srcs = ["identity_projection.cc"],
    hdrs = ["identity_projection.h"],
    tags = ["local"],
    deps = [
        ":projection_base",
        "//scann/data_format:datapoint",
        "//scann/utils:types",
    ],
)

cc_library(
    name = "projection_factory",
    srcs = select({
        "//conditions:default": ["projection_factory.cc"],
    }),
    hdrs = ["projection_factory.h"],
    tags = ["local"],
    deps = select({
        "//conditions:default": [
        ],
    }) + [
        ":chunking_projection",
        ":identity_projection",
        ":projection_base",
        "//scann/data_format:dataset",
        "//scann/proto:projection_cc_proto",
        "//scann/utils:common",
        "//scann/utils:types",
    ],
)

# Unit Tests
# ========================================================================
